package com.kaibes.module.email.sender;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.kaibes.web.api.ApiLink;
import com.kaibes.web.response.ResponseFactory;

@RestController
@RequestMapping("/emails/sender")
public class MailSenderApi {

    @Autowired
    private MailSenderService mailSenderService;
    
    @PutMapping
    @ApiLink("设置邮件发送人信息")
    public ResponseEntity<Object> putSender(@RequestBody @Validated SenderInfo temp) {
        return ResponseFactory.put(mailSenderService.save(temp), "修改邮件发送人信息成功", "修改邮件发送人信息失败");
    }
    
}
